<?php
$xtpl = new XTemplate("modules/home/left_panel_cate_content.htm");
//--
//--
$waypathlink = '&raquo;&nbsp;<a href="?mod=home&amp;act=left_panel_cate" class="waypath">Left Panel Menu</a>&raquo;&nbsp;<a href="#" class="waypath">Left Menu Content Management</a>';
$xtpl_main->assign("waypathlink",$waypathlink);
//--
$save_button = $GUI->button_ren("Save","javascript: doSaveLeftMenuPage();");
$xtpl->assign("save_button",$save_button);
//--
if($_POST[type] == 'EDIT' ){
	$POST = $_POST;
	$POST[lmc_content]= addslashes($POST[lmc_content]);
	$DB->DBUpdate('left_menu_content', $POST, "WHERE c_id='".$_POST[id]."'");
	//--
	$GUI->redir("?mod=home&act=left_panel_cate_content&id=".$_GET['id']);
}
//--
if($_GET['id'] == ''){
	$GUI->redir("?mod=home&act=left_panel_cate");
}
//--
$rs_chk = mysql_query("SELECT * FROM left_menu_content WHERE c_id = '".$_GET['id']."'");
if(mysql_num_rows($rs_chk) == 0){
	mysql_query("INSERT INTO left_menu_content (c_id, lmc_content) VALUES ('".$_GET['id']."', 'Some words here...')");
	$GUI->redir("?mod=home&act=left_panel_cate_content&id=".$_GET['id']);
}
//--
$row = mysql_fetch_array($rs_chk);
//--
$_FCKeditor = new FCKeditor("lmc_content");
$_FCKeditor->BasePath ="../admin/".$siteFCKeditorPath;
$_FCKeditor->Width = '95%';
$_FCKeditor->Height = '600';
$_FCKeditor->Value = stripslashes($row[lmc_content]);
//--
$row[id] = $_GET['id'];
$xtpl->assign("write",$row);
//--
//--
//--
?>